package com.example.mongo.model;

import org.springframework.data.mongodb.core.index.GeoSpatialIndexType;
import org.springframework.data.mongodb.core.index.GeoSpatialIndexed;

import java.io.Serializable;


public class User implements Serializable {
        private static final long serialVersionUID = -3258839839160856613L;
        private String  id;
        private String userName;
        private String passWord;
        /**
         * 2d坐标
         * 116.112 23.221
         */
        @GeoSpatialIndexed(type = GeoSpatialIndexType.GEO_2DSPHERE)
        private Double[] location;

        public User(String userName, String passWord) {
                this.userName = userName;
                this.passWord = passWord;
        }

        public String getId() {
                return id;
        }

        public void setId(String id) {
                this.id = id;
        }

        public String getUserName() {
                return userName;
        }

        public void setUserName(String userName) {
                this.userName = userName;
        }

        public String getPassWord() {
                return passWord;
        }

        public void setPassWord(String passWord) {
                this.passWord = passWord;
        }

        public Double[] getLocation() {
                return location;
        }

        public void setLocation(Double[] location) {
                this.location = location;
        }

        @Override
        public String toString() {
                return "User{" +
                        "id='" + id + '\'' +
                        ", userName='" + userName + '\'' +
                        ", passWord='" + passWord + '\'' +
                        '}';
        }
}
